//
//  OrderdetailTableViewCell.m
//  ECO
//
//  Created by zl on 2019/10/12.
//  Copyright © 2019 谷银行. All rights reserved.
//

#import "OrderdetailTableViewCell.h"

@implementation OrderdetailTableViewCell
- (UIImageView *)imgV{
    if (!_imgV) {
        _imgV = [[UIImageView alloc]init];
        _imgV.layer.cornerRadius = 7;
        _imgV.layer.masksToBounds = YES;
    }
    return _imgV;
}
- (UILabel *)Title{
    if (!_Title ) {
        _Title = [[UILabel alloc]init];
        _Title.numberOfLines = 0;
    }
    return _Title;
}
- (UILabel *)money{
    if (!_money) {
        _money = [[UILabel alloc]init];
        _money.textColor = [UIColor colorWithHexString:@"#FF615F"];
        _money.font = [UIFont systemFontOfSize:12];
    }
    return _money;
}
- (UILabel *)FanLabel{
    if (!_FanLabel) {
        _FanLabel = [[UILabel alloc]init];
        _FanLabel.backgroundColor = [UIColor colorWithHexString:@"#00DAAF"];
        _FanLabel.font = [UIFont systemFontOfSize:12];
        _FanLabel.textColor = [UIColor whiteColor];
        _FanLabel.layer.cornerRadius = 3;
        _FanLabel.layer.masksToBounds = YES;
        _FanLabel.textAlignment = UITextAlignmentCenter;
    }
    return _FanLabel;
}
- (UILabel *)Status{
    if (!_Status) {
        _Status = [[UILabel alloc]init];
        _Status.font = [UIFont systemFontOfSize:12];
    }
    return _Status;
}
- (UILabel *)OrderNumber{
    if (!_OrderNumber) {
        _OrderNumber = [[UILabel alloc]init];
        _OrderNumber.font = [UIFont systemFontOfSize:13];
    }
    return _OrderNumber;
}
- (UILabel *)OrderTime{
    if (!_OrderTime) {
        _OrderTime = [[UILabel alloc]init];
        _OrderTime.font = [UIFont systemFontOfSize:13];
    }
    return _OrderTime;
}
- (UILabel *)CutoffTime{
    if (!_CutoffTime) {
        _CutoffTime = [[UILabel alloc]init];
        _CutoffTime.font = [UIFont systemFontOfSize:13];
    }
    return _CutoffTime;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.imgV];
        [self.contentView addSubview:self.Title];
        [self.contentView addSubview:self.money];
        [self.contentView addSubview:self.FanLabel];
        [self.contentView addSubview:self.Status];
        [self.contentView addSubview:self.OrderNumber];
        [self.contentView addSubview:self.OrderTime];
        [self.contentView addSubview:self.CutoffTime];
        [self ViewFrame];
    }
    return self;
}
- (void)ViewFrame{
    // 图片
    [_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(15);
        make.left.equalTo(self.contentView).offset(15);
        make.width.height.equalTo(@(120));
    }];
    // 标题
    [_Title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(15);
        make.left.equalTo(self.imgV.mas_right).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.height.equalTo(@(60));
    }];
    // 金钱
    [_money mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.Title.mas_bottom).offset(11);
        make.left.equalTo(self.imgV.mas_right).offset(10);
        make.height.equalTo(@(19));
    }];
    // 返回多少钱
    [_FanLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.Title.mas_bottom).offset(8);
        make.left.equalTo(self.money.mas_right).offset(10);
        make.width.equalTo(@(65));
        make.height.equalTo(@(24));
    }];
    // 状态
    [_Status mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.money.mas_bottom).offset(15);
        make.left.equalTo(self.imgV.mas_right).offset(15);
        make.height.equalTo(@(19));
    }];
    // 订单号
    [_OrderNumber mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imgV.mas_bottom).offset(15);
        make.left.equalTo(self.contentView).offset(17);
        make.height.equalTo(@(18));
    }];
    // 下单时间
    [_OrderTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.OrderNumber.mas_bottom).offset(15);
        make.left.equalTo(self.contentView).offset(17);
        make.height.equalTo(@(18));
    }];
    // 结算时间
    [_CutoffTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.OrderTime.mas_bottom).offset(15);
        make.left.equalTo(self.contentView).offset(17);
        make.height.equalTo(@(18));
    }];
}

@end
